fontset = special1, "New York", 12, L2, nowordwrap;
fontset = special2, "New York", 12, L2, center, nowordwrap;
fontset = special3, "New York", 12, L2, right, nowordwrap;
fontset = special4, "New York", 12, L2, nowordwrap;
fontset = special5, "New York", 12, L2, nowordwrap;]
:[font = title; inactive; startGroup; Cclosed; ]
Lab 5: Applications of the Gradient
:[font = text; inactive; startGroup; Cclosed; ]
The gradient function was introduced in Lab 4. There we saw that it is the analog of the ordinary derivative of a function of a single variable. We used it to find the critical points of a function of two variables by solving the equation grad[f,x,y]==0.
:[font = text; inactive; endGroup; ]
In this lab we study other applications of the gradient function. Each of these applications is a direct generalization of an application of the ordinary derivative of a function of a single variable.
We begin by defining the gradient function. As in Lab 4, it is defined as the vector whose components are the partial derivatives of the given funtion f. However, the applications in this lab will be easier to set up if we use the following alternative definition.
:[font = input; ]
Clear["@*"];
grad[f_][x_,y_] = {D[f[x,y],x],D[f[x,y],y]};
grad[f][x,y]
:[font = text; inactive; endGroup; ]
The only difference between this form and the form grad[f,x,y] that we used in Lab 4 is that this one makes the grad a function of f whose value is another function of x and y. For all practical purposes, grad[f,x,y] and grad[f][x,y] work the same way; only the notation looks different.
The differential df of a function f of two variables is itself a function of four variables. It is defined to be the dot product of the two-component vector grad[f][x,y] and the two-component vector {dx,dy}. Here dx and dy are independent variables. This unusual notation is used traditionally because, in practice, dx and dy usually represent very small increments in x and y, respectively.
:[font = input; ]
Clear[f];
d[f_][x_,y_,dx_,dy_] = grad[f][x,y].{dx,dy};
d[f][x,y,dx,dy]
:[font = text; inactive; ]
When printed as output, partial derivatives are written with the vector superscript notation. Thus: (0,1)
f [x,y] means the partial of f with respect to y.
:[font = text; inactive; ]
Notice that we again define the object to be a function of the function f whose value is another function, this time of the four variables x, y, dx, and dy.
:[font = text; inactive; endGroup; ]
Functions like grad and d which transform one function into another are called operators.
Clearly, this is a function of the four variables x, y, dx, and dy.
:[font = text; inactive; startGroup; Cclosed; ]
Here's the value of the function at the point (x,y) = (1,2):
:[font = input; ]
d[f][1,2,dx,dy]
:[font = text; inactive; endGroup; ]
This is a function of the remaining two variables dx and dy.
:[font = text; inactive; startGroup; Cclosed; ]
Now, to appreciate the significance of the differential, we compare the two values of the function f at the nearby points (1,2) and (1.003,2.005):
:[font = input; ]
z0 = f[1,2]
:[font = input; endGroup; ]
z1 = f[1.003,2.005]
:[font = text; inactive; startGroup; Cclosed; ]
The difference betgween these two values is:
:[font = input; endGroup; ]
z1 - z0
:[font = text; inactive; startGroup; Cclosed; ]
This difference will be very nearly the same as the differential at the point (1,2) with increments dx=0.003 and dy=0.005:
:[font = input; ]
d[f][1,2,0.003,0.005]
:[font = text; inactive; endGroup; endGroup; ]
In practice (in the absence of Mathematica), the differential is usually easy to compute. So it is used to estimate the nearby value of f: f(x+dx,y+dy) = f(x,y) + df.
The tangent plane for a function of two variables is analogous to the tangent line for a function of one variable. The tangent line to a function y = f (x) at the point where x=x0 is y = f (x0) + f '(x0)(x-x0). The tangent plane to a function z = f (x,y) at the point (x,y)=(x0,y0) is z = f (x0,y0) + grad[f](x0,y0).{x-x0,y-y0}, where the dot is the dot product. But, as we just saw, that dot product is the differential d[f][x0,y0,x-x0,y-y0]:
The Chain Rule says that the derivative of a composite of functions is the product of the derivatives of their component functions. For functions of a single variable, this is:
:[font = input; ]
Clear[f,g,h,x,y];
D[f[g[x]],x]
:[font = text; inactive; startGroup; Cclosed; ]
Now suppose f is a function of two variables, each of which is itself a function of another variable t. Then, as above, we replace f ' with grad[f] and use the dot product:
This can also be done using the total derivative. Written Dt, it assumes that every variable is a function of something, thus leaving another Dt form in each term:
:[font = input; ]
Dt[f[x,y]]
:[font = text; inactive; endGroup; endGroup; ]
This is essentially the same as the differential equation:
First compute the total derivative Dt [f [x,y]] of the given function and compare it with the differential d[f][x,y,dx,dy]. Then define x and y as indicated (in terms of t) , re-exammine f [x,y], and compute its derivative with both D[f [x,y],t] and Dt [f [x,y]]. Simplify expressions wherever necessary.